import { Rule } from "./types";

export const PyupgradeRuleList: Rule[] = [
    {
        code: "UP001",
        name: "useless-metaclass-type",
        descEn: "__metaclass__ = type is implied",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP003",
        name: "type-of-primitive",
        descEn: "Use {} instead of type(...)",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP004",
        name: "useless-object-inheritance",
        descEn: "Class {name} inherits from object",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP005",
        name: "deprecated-unittest-alias",
        descEn: "{alias} is deprecated, use {target}",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP006",
        name: "non-pep585-annotation",
        descEn: "Use {} instead of {} for type annotations",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP007",
        name: "non-pep604-annotation",
        descEn: "Use X | Y for type annotations",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP008",
        name: "super-call-with-parameters",
        descEn: "Use super() instead of super(__class__, self)",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP009",
        name: "utf8-encoding-declaration",
        descEn: "UTF-8 encoding declaration is unnecessary",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP010",
        name: "unnecessary-future-import",
        descEn: "Unnecessary __future__ import {import} for target Python version",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP011",
        name: "lru-cache-without-parameters",
        descEn: "Unnecessary parameters to functools.lru_cache",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP012",
        name: "unnecessary-encode-utf8",
        descEn: "Unnecessary call to encode as UTF-8",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP013",
        name: "convert-typed-dict-functional-to-class",
        descEn: "Convert {name} from TypedDict functional to class syntax",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP014",
        name: "convert-named-tuple-functional-to-class",
        descEn: "Convert {name} from NamedTuple functional to class syntax",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP015",
        name: "redundant-open-modes",
        descEn: "Unnecessary open mode parameters",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP017",
        name: "datetime-timezone-utc",
        descEn: "Use datetime.UTC alias",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP018",
        name: "native-literals",
        descEn: "Unnecessary call to {literal_type}",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP019",
        name: "typing-text-str-alias",
        descEn: "typing.Text is deprecated, use str",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP020",
        name: "open-alias",
        descEn: "Use builtin open",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP021",
        name: "replace-universal-newlines",
        descEn: "universal_newlines is deprecated, use text",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP022",
        name: "replace-stdout-stderr",
        descEn: "Sending stdout and stderr to pipe is deprecated, use capture_output",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP023",
        name: "deprecated-c-element-tree",
        descEn: "cElementTree is deprecated, use ElementTree",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP024",
        name: "os-error-alias",
        descEn: "Replace aliased errors with OSError",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP025",
        name: "unicode-kind-prefix",
        descEn: "Remove unicode literals from strings",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP026",
        name: "deprecated-mock-import",
        descEn: "mock is deprecated, use unittest.mock",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP027",
        name: "unpacked-list-comprehension",
        descEn: "Replace unpacked list comprehension with a generator expression",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP028",
        name: "yield-in-for-loop",
        descEn: "Replace yield over for loop with yield from",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP029",
        name: "unnecessary-builtin-import",
        descEn: "Unnecessary builtin import: {import}",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP030",
        name: "format-literals",
        descEn: "Use implicit references for positional format fields",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP031",
        name: "printf-string-formatting",
        descEn: "Use format specifiers instead of percent format",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP032",
        name: "f-string",
        descEn: "Use f-string instead of format call",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP033",
        name: "lru-cache-with-maxsize-none",
        descEn: "Use @functools.cache instead of @functools.lru_cache(maxsize=None)",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP034",
        name: "extraneous-parentheses",
        descEn: "Avoid extraneous parentheses",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP035",
        name: "deprecated-import",
        descEn: "Import from {target} instead:",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP036",
        name: "outdated-version-block",
        descEn: "Version block is outdated for minimum Python version",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP037",
        name: "quoted-annotation",
        descEn: "Remove quotes from type annotation",
        descCn: "",
        autoFix: true,
    },
    {
        code: "UP038",
        name: "non-pep604-isinstance",
        descEn: "Use X | Y in {} call instead of (X, Y)	",
        descCn: "",
        autoFix: true,
    },
];